import { PermissionSetting } from '@/config'
import { PermissionSetting as PermissionType } from "@/types/config"
import { defineStore } from 'pinia'
import { ComputedRef, computed, reactive, ref } from 'vue';

export const usePermissionStore = defineStore('permission', () => {

    let projectConfig = reactive<PermissionType>(PermissionSetting)

    let isDynamicAddedRoute: ComputedRef<boolean> = computed(() => projectConfig.isDynamicAddedRoute)


    function setIsDynamicAddedRoute(val:boolean){
        projectConfig.isDynamicAddedRoute = val

    }
    return {
        projectConfig,
        isDynamicAddedRoute,
        setIsDynamicAddedRoute
    }
})